package com.seek.eduorder.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

/**
 * @author: wml
 * @since: 2022/3/19 0:45
 */
public class AlipayConfig {

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2021000119632402";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC6yJCy2tiMVEx6qE4SQLv66QsJAOlPr8ijZamD0iyqa/PHEYnKooYu6YV+ux8SDo/92+NqPeGv+w/1m5CALgdQaTWZXF7mS1n3EZixBjCYAi8EjCFWjsKbncpk/su0OL4pCVpzDt3t1p2tVnQm7dMMcLLF7YI2BFoKWSLDrx1al3TYRcThvg9zx9nRHf8UYi7Ut9dujSdNmO+bbH/DZxKa+lnFEkox9nePUdFhM1Dp95ZV7bPE3+fOOn16SNMjUEsw/3xHzPKfU7o2S2/9k2BqJNE6NBS/Bgtb3NtiRm1H/QqvZwoz8HM92A1TZQVJ92dLqNKVMDwfVQMOrZD/jU1lAgMBAAECggEAJl4IixS1Iq42P4PO9aTieDnikGjlg/7hwd6iIXfMwP0HyD5sBXm5Am3phAy/5x+iqEzAvBQWBeYWcycPWaUaz4OtBOGahMe5pSyyJrrUxIS+T7rRJkyQ4RJafsBv64c0WI2ZTMUjBTXukaqOlWiIz6desZWGB76BGFsS7wtLhk34Nw53JZB3Gfsy5Uiojb5rmOz0F/UWzv1QnHa+oI41fXGuJbO+T4yKzyd1al/3fLUP1COrnd6OIHuvUCm2lJRnOwrPo7mu2mYvu2hwG9TlEa/efb7yTk2RVIOUl1sDP6n2VRW5D4l8CcNFQXEeYt20ljioJdvMZeCrnVdVnKwrgQKBgQDmZ+ywzLcxL5j7ACp4srg+yuRoRxA0oSZ/I9n9S6XfLvOgZi+1EsbFmveaObvUZjc6JBg8bwbZ9zvOUWuOzw8xAI6iNSElrYSeDBhjD9Q37cccAnsnTsKGDpt+ocHap9TKLqUB3u/PCjLV/p/XqS/kzCcjDwhQRHayCMRt05X6EQKBgQDPiCTHe69q8R0EJ8n++femzJ7QsQfn6Kagz6s/lMIJZvIUeKxsXSnyAgBLbc0tZKsDcN0xBWejyLxvRGF0ll/9GsLgQxmXPY0LUu30KgKJFBmMpM/Iyfxn8FLMZii2LHAYqZq0JB6oUth3GVFLhbK3U8h1P2pl6LEuVjfitKkqFQKBgFH5ha+9livsyFv9Sh8ZTw4gN7WWGwDumPjBM6y3/nLyjIFz+eNNo+ToZtG7WsWN/HY2I11VDzX7jY6xTzhHGRuRHC5AAuQZ4UYt/Xs5RYMEmUOw6koo7nKtvcsHGCaIcd/hSpnozJ93/HBAoHQlYMHhlMcXcRjF0wkyr1h34DNRAoGBALe2XlCUxhmWLciC7Iahg0CN/LzjKgt6YR8UFxVmu0oVbpD+riwTYNFSQi6DmdDoP5cBL1142mEbjuu0jczmXTyylvZtj9bZbuUqWWj+U1ZDi8Z8E1A8tgrQrIsymDGELws2ALQdEWKSS/tKVzPSu/0b1uUr6SUjks1hF4HBycptAoGADNKFhkINN75pV+2MZFIEHY/1jYPuRE85ymZWVnLp5QN8sUgndg9DY7v2QXXU0EKSeFnlkwU3wCcLlk+2sbm+/36djiLmQUo+ALez24KE9RAeAIubgYbBvrHKLBd2/jwu4cvPTEBa8roBd6k5Ywc8Wg2mx1xuVs4YAnqR04wgwhg=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoGhL9mNTkxuIe9opyK6FrRoO8poWUEiFN5Fcq7nTKWmK0Viy6Ok/Dco2XliPRPQNcqIpzNaMjh6KtX48/oBgj+S4zEzu1n5SDk59SkLPrrwQje+e01LxBUo+gg3rEAsCuptDDPwRl28sOnLdK7p1MSCibWOgQvbED31rvP534Z52bKyP9MB+T/8EiOOLhnSWDdxXtXj9sJ+YFaj081eRNwZ49n5W3cQBTv4UPm1jgJAeO3kgb+YYo+WRdKyXM/faVIdWelpKDi/2lsq6wrmJFaWXfOfkfLwUpSNnTUmtgC18ULVMvcufm/BHJp7sQJdiHc8wF4MwmbSN8DYVXgUZsQIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
//    public static String notify_url = "http://工程公网访问地址/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";
    public static String notify_url = "http://localhost:3000/pay";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
//    public static String return_url = "http://工程公网访问地址/alipay.trade.page.pay-JAVA-UTF-8/return_url.jsp";
    public static String return_url = "http://localhost:3000/pay";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
//    public static String gatewayUrl = "https://openapi.alipay.com/gateway.do";
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
